package sweet.mvc.core

import scala.collection.{ mutable }
import sweet.helper.{ PropsContainer }
import sweet.mvc.api._

/** abstract control to add controllers mappings */
trait ControllerContainer {
  def controllers = _controllers.readOnly
  protected val _controllers = new mutable.HashMap[String, Controller]
  def addControllers(tuples: (String, Controller)*){
    for((k,v) <- tuples) _controllers(k) = v
  }  
}

/** abstract control to add layout templates mappings */
trait LayoutContainer {
  def layouts = _layouts.readOnly
  protected val _layouts = new mutable.HashMap[String, String]
  def addLayouts(tuples: (String, String)*){
    for((k,v) <- tuples) _layouts(k) = v
  }  
}
